# 列表的查找与删除

# in 判断是否存在
# a = [1, 2, 3, 4]
# print(1 in a)
# print(10 in a)
#
# print(1 not in a)
# print(10 not in a)

# index返回下标
# a = [1, 2, 3, 4]
# print(a.index(1))
# print(a.index(4))
# # 不存在,异常
# print(a.index(100))

# pop删除尾部的元素
# a = [1, 2, 3, 4]
# a.pop()
# print(a)
#
# # pop(pos)还可以指定下标删除
# a.pop(1)
# print(a)

# remove指定值删除
# a = [1, 2, 3, 4]
# print(a)
# a.remove(2)
# print(a)

# 列表的拼接
# 1. 直接+
a = [1, 2, 3, 4]
b = [5, 6, 7, 8]
# c = a + b
# c = b + a
# print(c)
# print(a)
# print(b)

# 2.extend拼接 没有返回值
# c = a.extend(b)
a.extend(b)
print(a)
print(b)
# print(c)

# 3. +=
# a += b
# print(a)
# print(b)
